﻿namespace ModelDll
{
    public class Model
    {
        public CellType[] cellArray;

        public sbyte[,] rowArray = new sbyte[,] { { 0, 0, 1, 2 }, { 0, 3, 4, 5 }, { 0, 6, 7, 8 }, { 0, 0, 3, 6 }, { 0, 1, 4, 7 }, { 0, 2, 5, 8 }, { 0, 0, 4, 8 }, { 0, 2, 4, 6 } };
        public sbyte[] rowBest = new sbyte[] { 4, 0, 2, 6, 8 };

        public Model()
        {
            this.TurnCount = 0;
            this.XWinsCount = 0;
            this.OWinsCount = 0;
            this.TurnType = true;
            this.cellArray = new CellType[9];
            this.GameTypeVar = GameType.playerVsPlayer;
            this.LevelAIvar = LevelAi.hard;
        }

        public void ResetRate()
        {
            this.rowArray = new sbyte[,] { { 0, 0, 1, 2 }, { 0, 3, 4, 5 }, { 0, 6, 7, 8 }, { 0, 0, 3, 6 }, { 0, 1, 4, 7 }, { 0, 2, 5, 8 }, { 0, 0, 4, 8 }, { 0, 2, 4, 6 } };
        }

        public GameType GameTypeVar { get; set; }

        public LevelAi LevelAIvar { get; set; }

        public int OWinsCount { get; set; }

        public byte TurnCount { get; set; }

        public bool TurnType { get; set; }

        public int XWinsCount { get; set; }

        public enum CellType
        {
            emptyCell,
            xCell,
            oCell
        }

        public enum GameType
        {
            playerVsPlayer,
            playerVsComputer
        }

        public enum LevelAi
        {
            easy,
            hard
        }
    }
}
